package com.market.domain;

import java.util.Locale;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "productinfo")
public class ProductInfo extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5997393957730465558L;
	
	
	@Override
	public boolean equalsId(Object o) {
		if((o instanceof ProductInfo) && ((ProductInfo)o).getId().equals(this.id)){
			return true;
		}
		return false;
	}
	
	public boolean isEmpty() {
		if ((this.description == null || this.description.isEmpty())
				&& (this.chineseDescription == null || this.chineseDescription
						.isEmpty())
				&& (this.frenchDescription == null || this.frenchDescription
						.isEmpty())
				&& (this.healthBenefits == null || this.healthBenefits
						.isEmpty())
				&& (this.frenchHealthBenefits == null || this.frenchHealthBenefits
						.isEmpty())
				&& (this.chineseHealthBenefits == null || this.chineseHealthBenefits
						.isEmpty())
				&& (this.nutritionValues == null || this.nutritionValues
						.isEmpty())
				&& (this.frenchNutritionValues == null || this.frenchNutritionValues
						.isEmpty())
				&& (this.chineseNutritionValues == null || this.chineseNutritionValues
						.isEmpty())) {
			return false;
		}
		return true;
	}

	public String getDescriptionLabel() {
		return super.getLabel("Description", super.getLocale());
	}

	public String getHealthBenefitsLabel() {
		return super.getLabel("HealthBenefits", super.getLocale());
	}

	public String getNutritionValuesLabel() {
		return super.getLabel("NutritionValues", super.getLocale());
	}

	public String getIngredientLabel() {
		return super.getLabel("Ingredient", super.getLocale());
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id = 0L;
	@Column(length = 1000)
	private String description;
	@Column(length = 1000)
	private String chineseDescription;
	@Column(length = 1000)
	private String frenchDescription;
	@Column(length = 1000)
	private String healthBenefits;
	@Column(length = 1000)
	private String chineseHealthBenefits;
	@Column(length = 1000)
	private String frenchHealthBenefits;
	@Column(length = 1000)
	private String nutritionValues;
	@Column(length = 1000)
	private String chineseNutritionValues;
	@Column(length = 1000)
	private String frenchNutritionValues;
	@Column(length = 1000)
	private String ingredients;
	@Column(length = 1000)
	private String chineseIngredients;
	@Column(length = 1000)
	private String frenchIngredients;

	

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getChineseDescription() {
		return chineseDescription;
	}

	public void setChineseDescription(String chineseDescription) {
		this.chineseDescription = chineseDescription;
	}

	public String getFrenchDescription() {
		return frenchDescription;
	}

	public void setFrenchDescription(String frenchDescription) {
		this.frenchDescription = frenchDescription;
	}

	public String getHealthBenefits() {
		return healthBenefits;
	}

	public void setHealthBenefits(String healthBenefits) {
		this.healthBenefits = healthBenefits;
	}

	public String getChineseHealthBenefits() {
		return chineseHealthBenefits;
	}

	public void setChineseHealthBenefits(String chineseHealthBenefits) {
		this.chineseHealthBenefits = chineseHealthBenefits;
	}

	public String getFrenchHealthBenefits() {
		return frenchHealthBenefits;
	}

	public void setFrenchHealthBenefits(String frenchHealthBenefits) {
		this.frenchHealthBenefits = frenchHealthBenefits;
	}

	public String getNutritionValues() {
		return nutritionValues;
	}

	public void setNutritionValues(String nutritionValues) {
		this.nutritionValues = nutritionValues;
	}

	public String getChineseNutritionValues() {
		return chineseNutritionValues;
	}

	public void setChineseNutritionValues(String chineseNutritionValues) {
		this.chineseNutritionValues = chineseNutritionValues;
	}

	public String getFrenchNutritionValues() {
		return frenchNutritionValues;
	}

	public void setFrenchNutritionValues(String frenchNutritionValues) {
		this.frenchNutritionValues = frenchNutritionValues;
	}

	public String getIngredients() {
		return ingredients;
	}

	public void setIngredients(String ingredients) {
		this.ingredients = ingredients;
	}

	public String getChineseIngredients() {
		return chineseIngredients;
	}

	public void setChineseIngredients(String chineseIngredients) {
		this.chineseIngredients = chineseIngredients;
	}

	public String getFrenchIngredients() {
		return frenchIngredients;
	}

	public void setFrenchIngredients(String frenchIngredients) {
		this.frenchIngredients = frenchIngredients;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

}
